<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
require_once(APPPATH . 'controllers/admin/application.php');

class Site_comment extends Application{
    public function __construct(){
        parent::__construct();
        
        if(!$this->my_auth->is_Admin()){
            redirect(base_url().$this->lang->lang()."/admin/wb_verify/login");
            exit();
        }elseif(!$this->my_auth->is_Access($this->router->fetch_class())){
            redirect(base_url().$this->lang->lang()."/admin/manage");
            exit();
        }
        
    }
    public function index(){
        redirect(base_url().$this->lang->lang()."/admin/comment/video");
        exit();
    }
    public function video(){
        $this->load->model("msite_video_comment");
        
        $data['miniTitle'] = lang('backend.manage')." ".lang('backend.admin_menu')." ".lang('backend.video');
        $data['text'] = "";
        $data['select'] = "";
        
        $config['base_url'] = base_url($this->lang->lang()."/admin/comment/video/page");
        $config['total_rows'] = $this->msite_video_comment->countAllData();
        $config['per_page'] = 10; 
        $config['uri_segment'] = 4;
        
        $this->pagination->initialize($config);
        
        $data['comment_list'] = $this->msite_video_comment->getAllData("DESC", $config['per_page'], $this->uri->segment(4));
        $this->my_layout->view("backend/site_comment-video",$data);
    }
    public function album(){
        $this->load->model("msite_album_comment");
        
        $data['miniTitle'] = lang('backend.manage')." ".lang('backend.admin_menu')." ".lang('backend.album');
        $data['text'] = "";
        $data['select'] = "";
        
        $config['base_url'] = base_url($this->lang->lang()."/admin/comment/album/page");
        $config['total_rows'] = $this->msite_album_comment->countAllData();
        $config['per_page'] = 10; 
        $config['uri_segment'] = 4;
        
        $this->pagination->initialize($config);
        
        $data['comment_list'] = $this->msite_album_comment->getAllData("DESC", $config['per_page'], $this->uri->segment(4));
        $this->my_layout->view("backend/site_comment-album",$data);
    }
}